# make html-version of this manual with:
# rmarkdown::render("sentence9.R")

# load necessary libraries and ad-hoc functions
source("preamble.R")

Word order

namesOrder <- "ich bin gewesen bei der frau gewesen und ich hab es zu ihr es gesagt und da sie hat sie gesagt sie dass sie hat es will sagen es auch zu ihre tochter es auch will sagen will hat"

dataOrder <- getAlignSyntax("../data/WS9/WS9_1syntax.txt", "WS9Transliteration", names = namesOrder)

# make into syntactically interesting features by using recoding profile
# write.recoding(dataOrder, file = "../data/WS9/recodingSyntax", attr = list( c(3,7), 8, 9, c(11,14), c(12,13), 16, c(17,18), c(19,21), 23, c(25,28,37,39), c(27,28,36,37,38), c(27,28,36,37,38), c(29,34), c(30, 35), 31, c(23,27,28,36,37,38) ))

order <- recode(dataOrder, "../data/WS9/recodingSyntax.yml")

titlesOrder <- list(
      tense.BIN.GEWESEN = "Tense and order of \'ich bin gewesen\'"
    , first.conjunction = "Overt conjunction in \'ich bin gewesen UND habe gesagt\'"
    , repetition.ICH = "Repeated pronoun in \'ich bin gewesen und ICH habe gesagt\'"
    , order.ES.IHR = "Order of \'ich habe ES IHR gesagt\'"
    , preposition.ZU.IHR = "Preposition before \'ihr\'"
    , second.conjunction = "Overt conjunction in \'Ich habe gesagt UND sie hat gesagt\'"
    , connector.DA = "Connector \'da\'"
    , tense.HAT.GESAGT = "Tense of \'sie hat gesagt\'"
    , complementizer.DASS = "Overt complementizer in \'sie sagte, DASS sie will\'"
    , order.WILL.SAGEN = "Order of \'sie WILL SAGEN\'"
    , interaction.DASS.WILL = "Interaction \'… DASS sie WILL sagen\'"
    , tense.HAT.WOLLEN.SAGEN = "Tense of \'sie hat sagen wollen"
    , absence.WILL.sagen = "Absence of \'sie WILL sagen\'"
    , order.ES.IHRE.TOCHTER = "Order of \'sie will ES IHRER TOCHTER sagen\'"
    , order.AUCH.IHRE.TOCHTER = "Order of \'sie will es AUCH IHRER TOCHTER sagen\'"
    , preposition.ZU.IHRE.TOCHTER = "Preposition before \'ihrer Tochter\'"
)

sapply(seq_along(titlesOrder), function(x) {
    plotSingle(order[,names(titlesOrder)[x]], titlesOrder[[x]])
    }) -> silent

Lexicon

namesLexicon <- list(
      bin = "bin sein war hab"
    , bei = "bei von nach zu mit"
    , frau = "Frau Weib Alten Basi Mutter"
    , gewesen = "gewesen gesein"
    , zu1 = "für an zu gegen"
    , ihr = "ihr der sie ihm/ihn"
    , sie1 = "sie die es hij ju"
    , sie2 = "sie ich die es hij ju"
    , will = "will tut geht soll macht"
    , auch = "auch schon gleich"
    , zu2 = "für an zu gegen"
    , ihrer = "ihr der sein mein ene"
    , tochter = "Tochter Mädchen Deern Mensch Lüte Gits Famen"
    )

lexicon <- getAlignLexicon("../data/WS9/WS9_2lexicon.txt", namesLexicon)

titlesLexicon <- list(
      bin = "ich BIN bei der Frau gewesen"
    , bei = "ich bin BEI der Frau gewesen"
    , frau = "ich bin bei der FRAU gewesen"
    , gewesen = "ich bin bei der Frau GEWESEN"
    , zu1 = "ich habe es ZU ihr gesagt"
    , ihr = "ich habe es zu IHR gesagt"
    , sie1 = "und SIE hat gesagt"
    , sie2 = "SIE will es auch zu ihrer Tochter sagen"
    , will = "sie WILL es auch zu ihrer Tochter sagen"
    , auch = "sie will es AUCH zu ihrer Tochter sagen"
    , zu2 = "sie will es auch ZU ihrer Tochter sagen"
    , ihrer = "sie will es auch zu IHRER Tochter sagen"
    , tochter = "sie will es auch zu ihrer TOCHTER sagen"
)

sapply(seq_along(titlesLexicon), function(x) {
    plotSingle(lexicon[,names(titlesLexicon)[x]], titlesLexicon[[x]])
    }) -> silent

Characters

namesChars <- list(
    ich1 = "i ch"
    , bin = "b i n"
    , sein1 = "s i n d"
    , gewesen = "g e w e s e n"
    , bei =  "b ei"
    , der1 = "d e r e r"
    , frau = "f r au w e n"
    , weib = "w ei b e n"
    , und1 = "u n d"
    , habe = "h a b e t"
    , es1 = "d a s"
    , gegen1 = "g e g e n"
    , ihr = "h i r e n"
    , gesagt1 = "g e s a g t"
    , und2 = "u n d"
    , sie1 = "s ie"
    , hat1 = "h a f t"
    , es2 = "d a s"
    , will = "w i ll e t e"
    , soll = "s o ll"
    , sagen = "s a g e n"
    , auch = "au ch"
    , an2 = "a n"
    , gegen2 = "g e g e n"
    , ihrer = "h i r e r e r"
    , tochter = "t o ch t e r n e"
    , mädchen = "m ä d e ch e n"
    , deern = "d i r n d l"
    )
    
dataChars <- getAlignChars("../data/WS9/WS9_3characters.txt", namesChars)

# profiles different for dutch and german because of different orthographic traditions
dataChars <- recodeChars(dataChars, langs = c("11","100"), "../data/WS9/graphemesNLD.txt")
dataChars <- recodeChars(dataChars, langs = c("1","10"), "../data/WS9/graphemesDEU.txt")

# write.recoding(dataChars, file = "../data/WS9/tmp.yml")
chars <- recode(dataChars, "../data/WS9/recodingChars.yml")

# plot character parameters
end <- which(colnames(chars) == "s_es13")

sapply(1:end, function(x) {
    plotSingle(chars[,x], colnames(chars)[x])
    }) -> silent

Agreement

agreement <- data.frame(
                chars$r_der13
                , lexicon$frau
                , lexicon$ihr
                , lexicon$sie1
                , lexicon$sie2
                , lexicon$ihrer
)

show Session Info

sessionInfo()
## R version 3.4.2 (2017-09-28)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS High Sierra 10.13.1
## 
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] spdep_0.6-15       sp_1.2-5           RColorBrewer_1.1-2
## [4] qlcData_0.1.0      qlcMatrix_0.9.5    sparsesvd_0.1-1   
## [7] slam_0.1-40        Matrix_1.2-12      qlcVisualize_0.1.0
## 
## loaded via a namespace (and not attached):
##  [1] nlme_3.1-131         bitops_1.0-6         gmodels_2.16.2      
##  [4] rprojroot_1.2        prabclus_2.2-6       docopt_0.4.5        
##  [7] tools_3.4.2          backports_1.1.1      R6_2.2.2            
## [10] rpart_4.1-11         KernSmooth_2.23-15   alphahull_2.1       
## [13] lazyeval_0.2.1       mgcv_1.8-22          colorspace_1.3-2    
## [16] trimcluster_0.1-2    nnet_7.3-12          raster_2.6-7        
## [19] gridExtra_2.3        splancs_2.01-40      compiler_3.4.2      
## [22] sgeostat_1.0-27      expm_0.999-2         TSP_1.1-5           
## [25] diptest_0.75-7       caTools_1.17.1       scales_0.5.0        
## [28] DEoptimR_1.0-8       spatstat.data_1.1-1  mvtnorm_1.0-6       
## [31] robustbase_0.92-8    spatstat_1.53-2      goftest_1.1-1       
## [34] stringr_1.2.0        digest_0.6.12        foreign_0.8-69      
## [37] spatstat.utils_1.7-1 rmarkdown_1.7        R.utils_2.6.0       
## [40] htmltools_0.3.6      maps_3.2.0           rlang_0.1.4         
## [43] shiny_1.0.5          mapplots_1.5         mclust_5.3          
## [46] gtools_3.5.0         dendextend_1.6.0     R.oo_1.21.0         
## [49] magrittr_1.5         modeltools_0.2-21    dotCall64_0.9-04    
## [52] Rcpp_0.12.13         munsell_0.4.3        abind_1.4-5         
## [55] viridis_0.4.0        R.methodsS3_1.7.1    stringi_1.1.5       
## [58] whisker_0.3-2        yaml_2.1.14          MASS_7.3-47         
## [61] flexmix_2.3-14       gplots_3.0.1         plyr_1.8.4          
## [64] grid_3.4.2           maptools_0.9-2       gdata_2.18.0        
## [67] deldir_0.1-14        lattice_0.20-35      splines_3.4.2       
## [70] tensor_1.5           knitr_1.17           boot_1.3-20         
## [73] fpc_2.1-10           tripack_1.3-8        codetools_0.2-15    
## [76] stats4_3.4.2         LearnBayes_2.15      gclus_1.3.1         
## [79] evaluate_0.10.1      mapdata_2.2-6        httpuv_1.3.5        
## [82] spam_2.1-1           foreach_1.4.3        gtable_0.2.0        
## [85] polyclip_1.6-1       kernlab_0.9-25       ggplot2_2.2.1       
## [88] mime_0.5             xtable_1.8-2         coda_0.19-1         
## [91] class_7.3-14         viridisLite_0.2.0    seriation_1.2-2     
## [94] tibble_1.3.4         iterators_1.0.8      registry_0.3        
## [97] fields_9.0           cluster_2.0.6